Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Beacon-api: broadcast blobs in the event of seen block #13830

Merged
merged 9 commits into from
Apr 2, 2024

Conversation

terencechain
Copy link
Member

Fixes #13824

As demanded by some mev-boost relayer configurations, we will broadcast blobs even if the event block of the same slot is observed over p2p. There's no reason to refrain from broadcasting these blobs, considering there is no risk of equivocation.

  • Export buildBlobSidecars for use across both the gRPC and REST packages.
  • Equivocation is captured in the variable errEquivocatedBlock.
  • If the error matches errEquivocatedBlock, then broadcast the blob sidecar.

@terencechain terencechain requested a review from a team as a code owner March 29, 2024 04:17
@terencechain terencechain force-pushed the broadcast-blobs branch 3 times, most recently from a99bd6f to 50ebcfd Compare March 29, 2024 14:53
@@ -2072,3 +2085,26 @@ func (s *Server) GetDepositSnapshot(w http.ResponseWriter, r *http.Request) {
},
)
}

func (s *Server) broadcastBlobSidecars(ctx context.Context, sb *eth.GenericSignedBeaconBlock) error {
Copy link
Contributor

@james-prysm james-prysm Mar 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth using the generic signed beacon block here?
if you just pass the Blobs and kzgProofs from the argument it'll save the New SignedBeacon block and Get deneb calls ( not sure if that saves anything) but I think you have the data of denebBlock already here

@terencechain terencechain added the Ready For Review A pull request ready for code review label Mar 29, 2024
"index": sc.Index,
"slot": sc.SignedBlockHeader.Header.Slot,
"kzgCommitment": fmt.Sprintf("%#x", sc.KzgCommitment),
}).Info("Broadcasted blob sidecar")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to help future debugging this function only runs for equivocatedblocks, can we add something to notify it for the reader of the logs?

james-prysm
james-prysm previously approved these changes Mar 29, 2024
prestonvanloon
prestonvanloon previously approved these changes Apr 2, 2024
@terencechain terencechain added this pull request to the merge queue Apr 2, 2024
Merged via the queue into develop with commit caa8be5 Apr 2, 2024
16 of 17 checks passed
@terencechain terencechain deleted the broadcast-blobs branch April 2, 2024 18:38
nisdas pushed a commit that referenced this pull request Jul 4, 2024
* Beacon-api: broadcast blobs in the event of seen block

* Fix parameters

* Fix test

* Check forkchoice

* Ran go format

* Revert "Ran go format"

This reverts commit 091e77e.

* James feedback

* Radek's feedback

Co-authored-by: Radosław Kapka <rkapka@wp.pl>

* Fix bad tests

---------

Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Audit beacon api propose block path for blob
4 participants